package cn.kgc.bilibili.controller;

import cn.kgc.bilibili.dao.VideoTypeMapper;
import cn.kgc.bilibili.pojo.VideoType;
import cn.kgc.bilibili.service.VideoTypeService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;


import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class VideoTypeController {
    /**
     * 郭鸿图
     */
    @Resource
    VideoTypeService videoTypeService;
    @GetMapping("/selectVideo")
    public Map<String,Object> selectAll(HttpServletRequest request){
        Map<String,Object> map = new HashMap<>();
        map.put("type",videoTypeService.querytypes());
        return map;
    }
    @GetMapping("/selectVideoByid/{id}")
    public Map<String,Object> selectVideoTypeByid(@PathVariable("id") Integer id){
        Map<String,Object> map = new HashMap<>();
        map.put("typeByid",videoTypeService.queryVideoTypeByid(1));
        return  map;
    }
}
